﻿using Core.SimpleTemp.Application.ServiceApp.SysApp.DataDicApp;
using Core.SimpleTemp.Application.SysApp.DepartmentApp.Dtos;
using Core.SimpleTemp.Common;
using Core.SimpleTemp.Entitys;
using Core.SimpleTemp.Repositories.Sys;
using Core.Toolkit.Core;
using Core.Toolkit.Core.Api;
using Core.Toolkit.Core.Application;
using Microsoft.EntityFrameworkCore;
using System;
using System.Threading.Tasks;

namespace Core.SimpleTemp.Application
{
    [AutoDi()]
    public class SysDataDicService : BaseAppService<SysDataDicDto, SysDataDic, SysDataDicRepository>
    {
        public SysDataDicService(SysDataDicRepository repository) : base(repository){}
        

        /// <summary>
        /// 逻辑删除，继承自基础服务类物理删除方法并重写调用基础仓储类逻辑删除方法
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="autoSave"></param>
        /// <returns></returns>
        public override async Task DeleteBatchAsync(Guid[] ids, bool autoSave = true)
        {
            foreach (Guid item in ids)
            {
                //调用基础仓储类中的逻辑删除方法
                await _repository.DeleteLogicAsync(item);
            }
        }
    }
}
